#include "card.h"

Card::Card()
{

}

Card::Card(Card::CardPoint point, Card::CardSuit suit)
{
    setPoint(point);
    setSuti(suit);
}

Card::CardPoint Card::getPoint() const
{
    return Point;
}

void Card::setPoint(const CardPoint &value)
{
    Point = value;
}

Card::CardSuit Card::getSuti() const
{
    return suti;
}

void Card::setSuti(const CardSuit &value)
{
    suti = value;
}

bool lessSort(const Card &c1, const Card &c2)
{
    if(c1.getPoint()==c2.getPoint())
    {
        return c1.getSuti()<c2.getSuti();
    }
    else {
        return c1.getPoint()<c2.getPoint();
    }
}

bool greateSort(const Card &c1, const Card &c2)
{
    if(c1.getPoint()==c2.getPoint())
    {
        return c1.getSuti()>c2.getSuti();
    }
    else {
        return c1.getPoint()>c2.getPoint();
    }
}

bool operator==(const Card &left, const Card &right)
{
    return left.getPoint()==right.getPoint()&&left.getSuti()==right.getSuti();
}

uint qHash(const Card &card)
{
    return card.getPoint()*100+card.getSuti();
}

bool operator <(const Card& c1, const Card& c2)
{
    return lessSort(c1, c2);
}
